package cate.common.table.activity.dungeonup;

import cate.common.annotation.SplitParse;
import cate.common.util.SplitParser;
import cate.common.util.random.RWItem;
import cate.common.util.random.RWList;
import easy.java.dev.note.NoteClass;

import java.util.List;

@NoteClass(value = "解析事件触发次数随机配置")
public class DUEventList extends RWList<DUEventList.Item> {

    public void parse(String config) {
        List<DUEventList.Item> l = SplitParser.parse(DUEventList.Item.class, config);
        this.setup(l);
    }

    public static class Item implements RWItem {

        @SplitParse(order = 0, note = "事件id")
        public int id;
        @SplitParse(order = 1, note = "事件权重")
        public int weight;
        @SplitParse(order = 2, note = "事件次数")
        public int time;

        @Override
        public double getWeight() {
            return weight;
        }
    }
}
